<template>
	<view class="page_content">
		<u-navbar   v-if="tabbarIndex !== 2" :title="['核销','输入编码',''][tabbarIndex]" :autoBack="true" :fixed="false"   :leftIcon="tabbarIndex == 0?'arrow-left':''" >
		</u-navbar>
			<One v-show="tabbarIndex == 0" class="main"></One>
			<Two v-show="tabbarIndex ==1"  class="main"></Two>
			<Three   v-show="tabbarIndex == 2" class="main" ></Three>
		<u-tabbar :value="tabbarIndex" @change="change1" :fixed="false" :placeholder="false" :safeAreaInsetBottom="false">
			<u-tabbar-item text="扫码核销" icon="home" @click="click1"></u-tabbar-item>
			<u-tabbar-item text="输入编码" icon="photo" @click="click1"></u-tabbar-item>
			<u-tabbar-item text="核销记录" icon="play-right" @click="click1"></u-tabbar-item>
		</u-tabbar>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				tabbarIndex: 2,
			};
		},

		methods: {
			click1(e) {
				console.log('click1', e);
				this.tabbarIndex = e
			},
			change1(e) {
				console.log("我是change-1", e);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.page_content {
		height: 100vh;
		padding-bottom: constant(safe-area-inset-bottom);
		/* iOS 11.0-11.2 */
		padding-bottom: env(safe-area-inset-bottom);
		/* iOS 11.2+ */
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	.main {
		flex: 1;
	box-sizing: border-box;
	overflow: hidden;
	}

	::v-deep .u-tabbar {
		flex: 0 1 auto !important;
	}
</style>